package com.hht.study.proxy.dynamic.jdk;

import com.hht.study.proxy.staticProxy.IHelloService;

/**
 * @author hht
 * @date 2022/3/6
 */
public class JDKTest {

    public static void main(String[] args) {
        JdkHelloServiceImpl jdkHelloService = new JdkHelloServiceImpl();
        IHelloService proxy = (IHelloService) JdkProxyFactory.getProxy(jdkHelloService);
        proxy.say();

        IBuyService jdkBuyService=new JdkBuyServiceImpl();
        IBuyService proxy2=(IBuyService) JdkProxyFactory.getProxy(jdkBuyService);
        proxy2.buy("iphone");
    }
}
